package com.dhcc.DRGsHosp.application.impl;

import java.util.List;
import java.util.Set;

import javax.inject.Named;

import org.springframework.transaction.annotation.Transactional;

import com.dhcc.DRGsHosp.application.MedinsApplication;
import com.dhcc.DRGsHosp.core.domain.Medins;

@Named
@Transactional
public class MedinsApplicationImpl implements MedinsApplication {

	public Medins getMedins(String parid) {
		return Medins.get(Medins.class, parid);
	}
	
	public void creatMedins(Medins medins) {
		medins.save();
	}
	
	public void updateMedins(Medins medins) {
		medins .save();
	}
	
	public void removeMedins(Medins medins) {
		if(medins != null){
			medins.remove();
		}
	}
	
	public void removeMedinss(Set<Medins> medinss) {
		for (Medins medins : medinss) {
			medins.remove();
		}
	}
	
	public List<Medins> findAllMedins() {
		return Medins.findAll(Medins.class);
	}
	
}
